<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/base_user.css">
    <title>退款详情</title>
</head>
<body>
<div class="wrap-pro">
    <div class="header">
        {eq name='item.type' value='1'}
        <p>退款详情</p>
        {else/}
        <p>退货详情</p>
        {/eq}
        <a href="javascript:history.back();">
            <img src="__STATIC__/img/back.png" class="back">
        </a>
    </div>
    <div class="state">
        {switch name="item.status"}
        {case value="1"}
        <p><img src="__STATIC__/img_user/yes_refund.png"><span>退款成功</span></p>
        <p>退款金额：<span>￥{$item.amount}</span></p>
        <p>退款时间：<span>{:date('Y-m-d H:i:s',$item.refund_time)}</span></p>
        {/case}
        {case value="2"}
        <p><img src="__STATIC__/img_user/no_refund.png"><span>退款失败</span></p>
        <p>退款金额：<span>￥{$item.amount}</span></p>
        {/case}
        {case value="3"}
        <p><img src="__STATIC__/img_user/audit_refund.png"><span>等待审核中</span></p>
        <p>退款金额：<span>￥{$item.amount}</span></p>
        {/case}
        {/switch}
    </div>
    <div class="list">
        <ul>
            <li>
                <h4>店铺名称</h4>
                <span>{$item.shop_title}</span>
            </li>
            <li>
                <h4>退款类型</h4>
                <span>{eq name='item.type' value='1'}仅退钱{else/}退货{/eq}</span>
            </li>
            <li>
                <h4>退款金额</h4>
                <span>￥{$item.amount}</span>
            </li>
            <li>
                <h4>退款说明</h4>
                <span>{$item.explain}</span>
            </li>
            <li>
                <h4>退款编号</h4>
                <span>{$item.order_number}</span>
            </li>
            <li>
                <h4>申请时间</h4>
                <span>{:date('Y-m-d H:i:s',$item.create_time)}</span>
            </li>
            {eq name='item.status' value='1'}
            <li>
                <h4>退款时间</h4>
                <span>{:date('Y-m-d H:i:s',$item.refund_time)}</span>
            </li>
            {/eq}
        </ul>
    </div>
    {eq name='item.type' value='2'}
    <div class="list">
        <ul>
            <li>
                <h4 onclick="see_express({$data})">查看物流</h4>
                <span></span>
            </li>
        </ul>
    </div>
    {/eq}
</div>
</body>
<script>
    //查看物流
    function see_express(id) {
        $.ajax({
            url: "{:url('mobile/member_order/refuend_return')}?order_id=" + id,
            dataType: 'json',
            type: 'post',
            success: function (data) {
                if (data.code == 400) {
                    layer.open({content: data.message, skin: 'msg', time: 2})
                } else {
                    window.location.href = "{:url('mobile/member_order/refuend_return')}?status={:input('status')}&order_id=" + id + "&title={:input('title')}";
                }
            },
            error: function () {
                layer.open({content: '网络繁忙,请重试', skin: 'msg', time: 2});
            }
        })
    }
</script>
</html>